<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title>File Upload</title>
</head>
<body>
    <form target="img" method="post" action="http://localhost:8888/fs/file/upload?catalog=test" enctype="multipart/form-data">
        <input type="file" name="file1" multiple="multiple" />
        <input type="text" name="reurl" value="http://localhost:8888/_black.html" style="display:none;" />
        <input type="submit" value="submit" />
    </form>
    <img src="" id="imgObj">
    <iframe name="img" id="imgIFrame" ></iframe>
</body>
<script type="application/javascript" >

    var _eIFrame = document.getElementById('imgIFrame');
    function uploadCallback(){
        var _str, _xml;
        if (_eIFrame.contentWindow) {
            _str = _eIFrame.contentWindow.document.body ? _eIFrame.contentWindow.document.body.innerHTML : null;
            _xml = _eIFrame.contentWindow.document.XMLDocument ? _eIFrame.contentWindow.document.XMLDocument : _eIFrame.contentWindow.document;
        } else if (_eIFrame.contentDocument) {
            _str = _eIFrame.contentDocument.document.body ? _eIFrame.contentDocument.document.body.innerHTML : null;
            _xml = _eIFrame.contentDocument.document.XMLDocument ? _eIFrame.contentDocument.document.XMLDocument : _eIFrame.contentDocument.document;
        }
        console.log(_str);

        _str = _str.replace(/<[^>]+>/g,"");//去掉所有的html标记;
        var _len = _str.length;
        _str = _str.substring(2, _len-2);


        document.getElementById('imgObj').src = _str;
        console.log(_str);
    }


    if (window.attachEvent) {
        _eIFrame.attachEvent('onload', uploadCallback);
    } else {
        _eIFrame.addEventListener('load', uploadCallback, false);
    }



</script>
</html>